<?php

include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");

session_start();

$admin_user = $_SESSION['username'] !='' ? $_SESSION['username'] : $_SESSION['mid'];



$result = array('error' => 1, 'message' => '', 'content' => '');

if($admin_user  == ''){

	$result['error'] = "1";
	$result['content'] = "未知错误，请重新登陆操作";

	echo json_encode($result,JSON_UNESCAPED_UNICODE);
	exit;
}


$act=$_REQUEST['act'];

if($act=='update_status'){


	$status = trim($_REQUEST['status']);

	$product_id = intval($_REQUEST['product_id']);

	if($product_id > 0){

		$res1 = mysql_query(" update athlon_product set publish = '$status'  WHERE nid = ".$product_id);

		if($res1){
			$result['error'] = "0";
			$result['message'] = "更新成功";
		}
		else{
			$result['error'] = "1";
			$result['message'] = "更新失败";
		}
	}
	else{
		$result['error'] = "1";
		$result['message'] = "参数有误";
	}
    echo json_encode($result,JSON_UNESCAPED_UNICODE);
    exit;

}

echo json_encode($result,JSON_UNESCAPED_UNICODE);
exit;

?>
